<!--
  Copyright 2017-2018 the original author or authors.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<div class="card">
  <div class="card-header">
    <h2>Synthetic monitors</h2>
  </div>
  <div class="card-body">
    <div ng-hide="hideMainContent()">
      <div ng-include src="'template/gt-loading-overlay.html'"></div>
      <div ng-include src="'template/gt-http-error-overlay.html'"></div>
      <div style="margin: 15px;">
        <div ng-if="!configs.length"
             style="font-style: italic;">
          There are no configured synthetic monitors
        </div>
        <div ng-repeat="config in configs"
             class="gt-second-line-indent"
             style="padding-bottom: 8px;">
          <a ng-href="config/synthetic-monitor{{configQueryString(config)}}">
            {{config.display}}
          </a>
        </div>
        <!-- ng-if="loaded" is used to prevent jitter of seeing this section very briefly
             before it gets pushed down by existing synthetic monitors -->
        <div ng-if="loaded && agentRollup.permissions.config.edit.syntheticMonitors"
             style="margin-top: 30px;">
          <a class="btn btn-primary"
             href="config/synthetic-monitor{{newQueryString()}}">
            Add new
          </a>
        </div>
      </div>
    </div>
  </div>
</div>
